package com.ec.system.api.modules.sys.feign.fallback;

import com.ec.core.common.core.api.ResponseMsg;
import com.ec.core.common.core.api.Result;
import com.ec.core.common.enums.GlobalResponseResultEnum;
import com.ec.system.api.modules.sys.dto.SysUserLoginDTO;
import com.ec.system.api.modules.sys.feign.ISysUserFeign;
import com.ec.system.api.modules.sys.vo.SysUserLoginVO;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * @author Eric
 * @Description: 相关接口服务降级回调方法
 */
@Slf4j
public class SysUserFeignFallback implements ISysUserFeign {
    @Setter
    private Throwable throwable;

    @Override
    public Result<SysUserLoginVO> sysUserLogin(SysUserLoginDTO sysUserLoginDTO) {
        log.error("[sysUserLogin]熔断异常信息:", throwable);
        return ResponseMsg.error(GlobalResponseResultEnum.INTERNAL_SERVER_BUSY_ERROR);
    }
}
